# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: execute.py
# Time: 16:54


from common.element.elements import PocoElement
from pages.login.handler import LoginHandler


class LoginBiz():
    def __init__(self, poco, log):
        self.__log = log
        self.__poco = PocoElement(poco, log)
        self.handler = LoginHandler(poco, log)


    def login(self, phon, password):
        '''
        登录
        :param phon: 账号
        :param password: 密码
        :return:
        '''
        self.__poco.click_input_contents(self.handler.get_zhanghaoshuru(), phon)
        self.__poco.click_input_contents(self.handler.get_mimashuru(), password)
        self.__poco.click_on_the_element(self.handler.get_dengluanniu())
        self.__poco.poco_smart_click(self.handler.get_dengluhouquanxian())
        self.__poco.the_direction_of_the_sliding("left", 2)
        self.__poco.click_on_the_element(self.handler.get_guanbiguanggao())
